<template>
	<view class="page_view">
		<view class="user_pl" v-for="(item,index) in list" :key="index">
			<view class="user_pl_user">
				<image class="user_pl_user_img" :src="ImgUrl + item.doctor.avatar" mode=""></image>
				<view class="user_pl_pl">
					<view class="user_pl_name">{{item.doctor.name}}</view>
					<u-rate size="10" inactiveColor="#626262" :readonly="true" gutter="2" activeColor="#DD504A" :count="count" v-model="item.star"></u-rate>
				</view>
			</view>
			<view class="pl_text">
				{{item.content}}
			</view>
			<view class="pingjia_img flex1">
				<image :src="ImgUrl + item.img" class="pingjia_img_item" mode=""></image>
			</view>
		</view>
		<view class="" v-if="list.length == 0">
			<u-empty text="列表数据为空" mode="list"></u-empty>
		</view>
	</view>
</template>

<script>
	import { comment } from '../../api/common.js';
	export default {
		data() {
			return {
				count:5,
				star:4,
				list:[]
			}
		},
		mounted() {
			this.getList();
		},
		computed:{
			ImgUrl(){
				console.log(this.$store.state.ImgUrl)
				return this.$store.state.ImgUrl
			},
		},
		methods: {
			getList(){
				comment().then(res=>{
					if(res.code == 200001){
						this.list = res.data.data;
					}
				})
			}
		}
	}
</script>

<style>
.user_pl {
		margin-top: 30rpx;
	}
	.user_pl_user {
		display: flex;
		align-items: center;
	}
	.user_pl_user_img {
		width: 64rpx;
		height: 64rpx;
		border-radius: 50%;
		background-color: #333;
	}
	.user_pl_name {
		color: var(--unnamed, #626262);
		font-family: Alibaba PuHuiTi 2;
		font-size: 22rpx;
		font-style: normal;
		font-weight: 400;
		line-height: normal;
	}
	.user_pl_pl {
		margin-left: 20rpx;
	}
	.pl_text {
		margin-top: 24rpx;
		color: #333;
		font-family: Alibaba PuHuiTi 2;
		font-size: 24rpx;
		font-style: normal;
		font-weight: 400;
		line-height: normal;
	}
	.pingjia_img{
		margin-top: 20rpx;
	}
	.pingjia_img_item{
		width: 128rpx;
		height: 128rpx;
		border-radius: 8rpx;
		background:#ccc;
		margin-right: 8rpx;
	}
	.page_view{
		width: 100%;
		padding: 0 30rpx;
		box-sizing: border-box;
	}
</style>
